﻿@{
	ViewBag.Title = "控制面板";
}
@section header{
	<style>
		a.menu-item {
			display: flex;
			justify-content: center;
			flex-direction: column;
			align-items: center;
			margin-right: 30px;
		}

		a.menu-item i, a.menu-item span {
			display: block;
		}

		a.menu-item i {
			font-size: 35px;
		}

		a.menu-item span {
			font-weight: bold;
			font-size: 12px;
		}

		a.menu-item:hover {
			text-decoration: none;
		}

		a.menu-item:hover span {
			text-decoration: underline;
		}

		.detail-heading {
			height: 30px;
			font-size: 14px;
		}
	</style>
}
@section quickmenu{
	<td style="padding-right: 0px; padding-left: 10px;visibility:hidden;">
		<span style="cursor: pointer;" title="返回..." @@click="pageBack">
			<i class="icon-reply icon-2x pull-left icon-border crm-bu-style"></i>
		</span>
	</td>
}




<table border="0" cellspacing="0" cellpadding="0" style="margin:0 auto 10px;width:98%;">
	<tr>
		<td>
			<div class="detail-panel-div">
				<table border="0" cellspacing="0" cellpadding="0" style="width:100%;" v-for="gm in menus">
					<tr class="detail-heading">
						<td>
							&nbsp;&nbsp;{{gm.Name}}
						</td>
					</tr>
					<tr>
						<td>
							<div style="padding:10px;display:flex;flex-wrap:wrap;">
								<a v-for="m in gm.Children" :href="m.Url" class="menu-item">
									<i :class="m.Icon"></i>
									<span>{{m.Name}}</span>
								</a>
							</div>
						</td>
					</tr>
				</table>
			</div>
		</td>
	</tr>
</table>


@section footer{
	@await Component.InvokeAsync("AdminMenu")

	<script type="text/javascript">
		var pageEnumData = {
		};
		var pageData = {
			hideBreadcrumb: false,
			serviceCode: '@(ViewBag.ServiceCode)',
			global: globalData,
			menus:pageMenuData
		};

		var pageApp = new Vue({
			el: '#app',
			data: pageData,
			created: function () {
			},
			mounted: function () {
			},
			methods: {
				pageBack: function () {
					//history.go(-1);
					history.back();
				}
			},
			computed: {
				currentM: function () {
					var currentM = null;
					var i;
					var j;
					for (i = 0; i < this.global.modules.length; i++) {
						for (j = 0; j < this.global.modules[i].Services.length; j++) {
							if (this.serviceCode == this.global.modules[i].Services[j].Code) {
								currentM = this.global.modules[i];
								break;
							}
						}
					}
					return currentM;
				},
				currentS: function () {
					var currentS = null;
					var i;
					var j;
					for (i = 0; i < this.global.modules.length; i++) {
						for (j = 0; j < this.global.modules[i].Services.length; j++) {
							if (this.serviceCode == this.global.modules[i].Services[j].Code) {
								currentS = this.global.modules[i].Services[j];
								break;
							}
						}
					}
					return currentS;
				}
			}
		});
	</script>
}